#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "ximea.h"
#include "systeminfo.h"
#include "gpio.h"
#include "dvpcam.h"
#include <QTimer>
#include <QSettings>
#include <QMouseEvent>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    void loadStyleSheet(QString name);

private slots:
    void readImageSlot();
    void on_exposure_spinBox_valueChanged(int arg1);
    void on_gain_doubleSpinBox_valueChanged(double arg1);
    void on_shoot_pushButton_clicked();
    void CPUUsageSlot(double u);
    void MEMUsageSlot(double u);
    void TimeSlot(QString t);

    void on_exposure_horizontalSlider_valueChanged(int value);

    void on_gain_horizontalSlider_valueChanged(int value);
    void deviceTypeSlot(QString s);
    void timerOutSlot();

protected:
    void mousePressEvent(QMouseEvent *event);
    void keyPressEvent(QKeyEvent *event);

signals:
    void exposureSignal(int exp);
    void gainSignal(double gian);
    void shotSignal();

private:
    Ui::MainWindow *ui;
    Ximea *_ximea;
    SystemInfo *systemInfo;
    Gpio *gpio;
    Dvpcam *dvp0;
    dvpStatus dvpstatus;
    QTimer *qtimer;
    QSettings *settings;
};

#endif // MAINWINDOW_H
